<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>新增教师</title>
</head>
<body>
<h1>新增教师</h1>
<form th:action="@{/saveTeacher}" th:object="${teacher}" method="post">
    姓名: <input type="text" th:field="*{name}"><br>
    <span th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></span><br>
    专业: <input type="text" th:field="*{major}"><br>
    <span th:if="${#fields.hasErrors('major')}" th:errors="*{major}"></span><br>
    <button type="submit">保存</button>
</form>
</body>
<a href="/">返回首页</a>
</html>